import request from '@/utils/request'

// 创建危险源
export function createHazardResource(data) {
  return request({
    url: '/biz/hazard-resource/create',
    method: 'post',
    data: data
  })
}

// 更新危险源
export function updateHazardResource(data) {
  return request({
    url: '/biz/hazard-resource/update',
    method: 'put',
    data: data
  })
}

// 删除危险源
export function deleteHazardResource(id) {
  return request({
    url: '/biz/hazard-resource/delete?id=' + id,
    method: 'delete'
  })
}

// 获得危险源
export function getHazardResource(id) {
  return request({
    url: '/biz/hazard-resource/get?id=' + id,
    method: 'get'
  })
}

// 获得危险源分页
export function getHazardResourcePage(query) {
  return request({
    url: '/biz/hazard-resource/page',
    method: 'get',
    params: query
  })
}

// 导出危险源 Excel
export function exportHazardResourceExcel(query) {
  return request({
    url: '/biz/hazard-resource/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
